/**
 * cateGory: 折线图
 */
import { xAxisCommon, yAxisCommon, colorCommon } from '../common-option'
import { mergeOption, setSeries } from '../util'
export default {
  name: 'line',
  option(param) {
    return mergeOption(param, {
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          // 坐标轴指示器，坐标轴触发有效
          type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
        }
      },
      legend: {
        bottom: 0,
        itemWidth: 18,
        itemHeight: 10,
        textStyle: {
          color: '#999'
        },
        data: []
      },
      color: colorCommon,
      grid: {
        left: '0',
        right: '0',
        top: '30px',
        bottom: '30px',
        containLabel: true
      },
      xAxis: {
        type: 'category',
        data: [],
        ...xAxisCommon
      },
      yAxis: {
        type: 'value',
        name: '',
        ...yAxisCommon
      },
      series: setSeries({ series: param.series })
    })
  }
}
